Repository navigation
refactor(cuda.core): name the states of a ReleasingHandleRegistry entry - #3547
Conversation
get_or_create() told "release in flight" apart from "live" by whether an entry's weak_ptr had expired, inside a hand-written wait loop. Name the three states (Vacant, Live, Releasing) and wait on a predicate. No behavior change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Rob Parolin <rparolin@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
find() returned the state and filled the owner through an out parameter. Return both in a Lookup struct. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Rob Parolin <rparolin@nvidia.com>
find() said "requires mutex_" in a comment. It now takes the caller's unique_lock and raises an internal error unless that lock is held and locks this registry's mutex. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Rob Parolin <rparolin@nvidia.com>
|
No actionable comments were generated in the recent review. Summary
Change: Refactor Merge Risk:
|
clang-tidy's modernize-use-nodiscard rejects find() in the Windows build. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Rob Parolin <rparolin@nvidia.com>
|
| [[nodiscard]] Lookup | ||
| find(const std::unique_lock<std::mutex> &held, const Key &key) const | ||
| { | ||
| if (!held.owns_lock() || held.mutex() != &mutex_) { |
There was a problem hiding this comment.
This check seems unnecessary. find requiring the lock as parameter is sufficient.
There was a problem hiding this comment.
That check is there b/c you can pass a reference to a mutex into a function. That does mean the thread has acquired the lock. That's what we are checking there.
Description
Readability follow-up to #3511. Part 1 of 4 (stack: #3547 → #3548 → #3549 → #3552). No behavior change on any path that exists today.
ReleasingHandleRegistry::get_or_create()told "release in flight" apart from "live owner" by whether aweak_ptrhad expired, inside a hand-written wait loop.Vacant,Live,Releasing.find()returns the state and the owner together in aLookupstruct.find()takes the caller'sunique_lockand raises an internal error unless it is held on this registry's mutex. The rule was a comment before.Insert-before-create and
release()are untouched.Testing
cuda_coretest suite passes on an RTX 5880 Ada (cu13), excepttest_object_code_load_rdc*, which cannot build its fixture on my machine (system nvcc rejects the environment's gcc).PLC Local Security Evidence (Advisory)
Local advisory checks only, run over the whole stack. Not release-gate results.
Checklist
🤖 Generated with Claude Code